package com.atguigu.f_array;

public class Demo4 {
    public static void main(String[] args) {
        //动态初始化数组
        int[] arr = new int[3];
        System.out.println("arr = " + arr);

        //遍历数组
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

        //修改指定索引位置的元素
        arr[1] = 100;

        //遍历数组
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

        //静态初始化
        boolean[] flags = {false,true};
        System.out.println("flags = " + flags);

    }
}
